{% extends "admin/bases.html" %}
 {% import "admin/fy.html" as pg %}

{% block content %}

  
  <body>
   
    <div class="x-body">

    <xblock>
        <button class="layui-btn" onclick="x_admin_show('修改权限','{{url_for("admin.comminrole")}}')">修改权限</button>
         <button class="layui-btn" onclick="x_admin_show('修改部门和职务','{{url_for("admin.bumen")}}')">修改部门和职务</button>


    </xblock>
      <table class="layui-table">
        <thead>
          <tr>

            <th>ID</th>
            <th>登录名</th>
            <th>姓名</th>
            <th>性别</th>
            <th>邮箱</th>
            <th>手机</th>
            <th>所属部门</th>
            <th>职务</th>
            <th>权限</th>
            <th>加入时间</th>


        </thead>
        <tbody>
    {% for i in page_data.items %}
          <tr>

            <td>{{i.user_id}}</td>
            <td>{{i.user_count}}</td>
            <td>{{i.user_name}}</td>
            <td>{{i.user_sex}}</td>
            <td>{{i.user_mail}}</td>
            <td>{{i.user_phone}}</td>
            <td>{{i.user_section}}</td>
            <td>{{i.user_duty}}</td>
            <td>{{i.user_power}}</td>
            <td>{{i.user_addtime}}</td>


            </td>
          </tr>
        {% endfor %}
        </tbody>
      </table>
        {{pg.page(page_data,'admin.admin_list')}}

    </div>
    <script>

      function member_stop(obj,id){
          layer.confirm('确认要停用吗？',function(index){

              if($(obj).attr('title')=='启用'){
                console.log(id)
                $(obj).attr('title','停用')
                $(obj).find('i').html('&#xe62f;');
                    $.get(
                    'http://127.0.0.1/admin/admin_pass?id='+id,
                    function(html){
                        console.log(id)
                     parent.location.reload();
                    }
                    );
                $(obj).parents("tr").find(".td-status").find('span').addClass('layui-btn-disabled').html('已停用');
                layer.msg('已停用!',{icon: 5,time:1000});

              }else{
                $(obj).attr('title','启用')
                $(obj).find('i').html('&#xe601;');

                $(obj).parents("tr").find(".td-status").find('span').removeClass('layui-btn-disabled').html('已启用');
                layer.msg('已启用!',{icon: 5,time:1000});
              }
              
          });
      }


    </script>

{% endblock %}

